// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------

import request from '@/utils/request'


/**
 * 新增
 * @param
 */
export function doAdd(data) {
  return request({
    url: '/saveNotice',
    method: 'post',
    data
  })
}

/**
 * 删除
 * @param
 */
export function doDel(pram) {
  const data = {
    id: pram.id
  }
  return request({
    url: '/deleteNoticeById',
    method: 'GET',
    params: data
  })
}

/**
 * 分页列表
 * @param
 */
export function getList(pram) {
  const data = {
    page: pram.page,
    limit: pram.limit,
    keyword: pram.title
  }
  return request({
    url: '/getNoticeList',
    method: 'get',
    params: data
  })
}

/**
 * 修改
 * @param
 */
export function updateStatusApi(pram) {
  const data = {
    status: pram.status,
    id: pram.id
  }
  return request({
    url: '/updateNoticeStatus',
    method: 'post',
    data: data
  })
}

/**
 * 党建分页列表
 * @param
 */
export function getBuildList(pram) {
  const data = {
    page: pram.page,
    limit: pram.limit,
    keyword: pram.title
  }
  return request({
    url: '/getBuildList',
    method: 'get',
    params: data
  })
}
/**
 * 家政分页列表
 * @param
 */
export function getServiceList(pram) {
  const data = {
    page: pram.page,
    limit: pram.limit,
    keyword: pram.title
  }
  return request({
    url: '/getServiceList',
    method: 'get',
    params: data
  })
}
/**
 * 党建管理新增
 * @param
 */
export function saveBuild(data) {
  return request({
    url: '/saveBuild',
    method: 'post',
    data
  })
}
/**
 * 党建管理修改状态
 * @param
 */
export function updateBuildStatus(pram) {
  const data = {
    status: pram.status,
    id: pram.id
  }
  return request({
    url: '/updateBuildStatus',
    method: 'get',
    params: data
  })
}
/**
 * 家政服务新增
 * @param
 */
export function saveService(data) {
  return request({
    url: '/saveService',
    method: 'post',
    data
  })
}
/**
 * 住户信息分页列表
 * @param
 */
export function getHousePersonList(pram) {
  const data = {
    page: pram.page,
    limit: pram.limit,
    keyword: pram.title
  }
  return request({
    url: '/getHousePersonList',
    method: 'get',
    params: data
  })
}
/**
 * 住户信息状态修改
 * @param
 */
export function updateHousePersonStatus(pram) {
  const data = {
    status: pram.status,
    id: pram.id
  }
  return request({
    url: '/updateHousePersonStatus',
    method: 'get',
    params: data
  })
}
/**
 * 住户信息删除
 * @param
 */
export function deleteHousePersonById(pram) {
  const data = {
    id: pram.id
  }
  return request({
    url: '/deleteHousePersonById',
    method: 'GET',
    params: data
  })
}
/**
 * 新增住户信息
 * @param
 */
export function saveHousePerson(data) {
  return request({
    url: '/saveHousePerson',
    method: 'post',
    data
  })
}
